<template>
	<view class="box-con">
		<view class="box-con-title">昵称</view>
		<input @input="inputNickname" class="box-con-input" maxlength="16" placeholder="请输入昵称" type="text"
			v-model="nickname" />
		<view class="box-con-clear" @click="nickname=''" v-if="nickname">
			<image :src="clearImg"></image>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				//删除图标
				clearImg: require('@/static/img/login/clear.svg'),
				nickname: ''
			}
		},
		methods: {
			inputNickname() {
				//console.log(this.nickname)
				this.$emit('inputNickname', this.nickname)
				
			}
		}
	}
</script>

<style scoped lang="scss">
	.box-con {
		width: 92%;
		margin-left: 4%;
		border-bottom: 2rpx solid #eee;
		display: flex;
		height: 100rpx;
		font-size: 32rpx;
		margin-bottom: 30rpx;

		.box-con-title {
			width: 20%;
			line-height: 100rpx;
			font-weight: 550;
		}

		.box-con-input {
			width: 60%;
			font-size: 32rpx;
			height: 50rpx;
			margin-top: 25rpx;
		}

		.box-con-clear {
			width: 20%;
			text-align: center;

			image {
				width: 50rpx;
				height: 50rpx;
				margin-top: 25rpx;
			}
		}

	}
</style>
